import path from 'path'
import Components from 'unplugin-vue-components/vite'
import Unfonts from 'unplugin-fonts/vite'
import vue from '@vitejs/plugin-vue'
import {createSvgIconsPlugin} from 'vite-plugin-svg-icons'
import {defineConfig} from 'vite'

// @ts-ignore
export default defineConfig({
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src'),
        },
    },
    plugins: [
        vue(),
        Components({
            dirs: ['src/components'],
            deep: true,
            dts: true,
            types: [{
                from: 'vue-router',
                names: ['RouterLink', 'RouterView'],
            }],
        }),
        createSvgIconsPlugin({
            iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
            symbolId: '[dir]:[name]',
        }),
        Unfonts({
            google: {
                families: [
                    {name: 'Inter', styles: 'wght@200;400;500;600'}
                ]
            }
        })
    ],
})
